{% extends "layout.html" %}

{% block css %}
<style>
    .is-hidden {
        display: none;
    }
</style>
<link rel="stylesheet" href="/static/Bootstrap-select_files/bootstrap.min.css">
<link rel="stylesheet" href="/static/Bootstrap-select_files/bootstrap-select.css">
<link rel="stylesheet" href="/static/content/change.css">
{% if overDue == False %}
<script>
    alert('您无法在工期内完成所有事项，请重新输入哦！');
</script>
{% endif %}
{%if isCircle == True%}
<script>
    alert('存在圈，请重新输入哦！');
</script>
{% endif%}
{% endblock %}
{% block content %}
<div id="search_container">
    <input id="search_in" type="text" name="search" placeholder="输入查找的项目名称">
    <button id="search">查找</button>
</div>
<form id="form_body" οnsubmit="return false;" action="" method="post" role="form">
    <!--{#    模板参数将被替换为一个隐藏字段，用来是实现在配置中激活的 csrf 保护。如果你已经激活了 csrf，这个字段需要出现在你所有的表单中#}
    {#      注：只有flaskform类有{ form.hidden_tag }}方法，form类中没有#}
    {#    <div class="is-hidden">{ form_one.hidden_tag }}</div>#}
    {#    { form_one.csrf_token }}#}-->
    <div id="form">
        <div id="subform_project">
            <div id="project_name_container">
                {{form_one.csrf_token}}
                {{form_one.project_id(value=request.args.get('project_id'))}}
                {{ form_one.project_name.label }}
                {{ form_one.project_name }}
                {% for error in form_one.project_name.errors %}
                <br><span style="color: rgb(16, 9, 76);margin-left: 138px;">{{ error }}</span>
                {% endfor %}
            </div>
            <div id="project_pretime_container">
                {{ form_one.project_ST.label }}
                {{ form_one.project_ST }}
            </div>
            <div id="project_suctime_container">
                {{ form_one.project_FT.label }}
                {{ form_one.project_FT }}
            </div>

        </div>

        <div id="subforms_container">
            <div class="scrollbar"></div>
        </div>
    </div>
    <!--{#    提交按钮在这！！#}-->
    <div class="form_up" style="border-radius: 2px;">
        <button id="ssubmit">提交</button>
    </div>
</form>
<div class="form_add" style="border-radius: 2px;">
    <button id="add">新建事项</button>
</div>

<div id="item-_-form" class="is-hidden" data-index="_">
    <!--{#    label for 与相应id的表单元素相绑定#}-->
    <input id="items-_-item_name" name="items-_-item_name" data-id="_" type="text" value="" placeholder="事件名称">
    <label for="items-_-item_pre">前驱事件</label>
    <select id="items-_-item_pre" name="items-_-item_pre" data-id="_" type="text" class="select_picker"
            data-live-search="true" multiple></select>
    <input id="items-_-item_LT" name="items-_-item_LT" data-id="_" type="text" value="" placeholder="持续时间（天）">

    <button class="remove" type="button">删除</button>
</div>


{% endblock %}

{% block scripts %}

<!--<script src="/static/Bootstrap-select_files/jquery.min.js.下载"></script>-->
<script src="/static/Bootstrap-select_files/bootstrap.min.js.下载"></script>
<script src="/static/Bootstrap-select_files/bootstrap-select.js.下载"></script>
<script src="/static/scripts/change.js"></script>
{% endblock %}